#ifndef COSTRING_H
#define COSTRING_H

typedef struct {
    COVALUE_HEAD
    ssize_t s_size;
    long s_hash;
    char s_val[1];
} CoString;

extern CoType CoString_Type;

#define COSTRING_CHECK(self)   CO_CHECK_TYPE(self, &CoString_Type)

CoValue *CoString_FromString(const char *raw);
CoValue *CoString_FromStringAndSize(const char *raw, ssize_t size);
CoValue *CoString_Concat(CoValue *v, CoValue *w);

#define CoString_AS_STRING(self)  (((CoString *)(self))->s_val)

#endif
